<template>
	<view class="page">
		<view class="recordCard recored-bottom" v-for="(item,index) in recordList" :key="index">
			<view class="u-flex u-row-between">
				<h4>{{item.task_name}}</h4>
				<view :style="{color:$u.color['tipsColor']}">{{item.addtime}}</view>
			</view>
			<view class="u-flex u-col-center integral">
				<u-icon :name="imgStaticUrl+'/images/icon-score2.png'" color="#ff9900" size="38"></u-icon>
				<text v-if="item.class==0">+</text>
				<text v-else>-</text>
				{{item.integral}}
			</view>
		</view>
		<u-empty v-if="recordList.length===0" :src="STATICURL+'images/nullStatus/noList.png'" margin-top="200" icon-size="300"
			:text="$t('暂无数据')"></u-empty>
	</view>
</template>

<script>
	export default {
		name: "recordList",
		data() {
			return {
				imgStaticUrl: '',
				recordList: []
			}
		},
		onLoad() {
			this.imgStaticUrl = this.STATICURL;  // 线上图片地址（兼容微信小程序写法）
			this.getIntegralRecordList()
		},
		methods: {
			getIntegralRecordList() {
				const data = {

				}
				this.$http.getIntegralRecordList(data).then(res => {
					this.recordList = res.data.record_list
					// addtime: "2020-12-18 23:11:13"
					// class: 0
					// id: 1
					// integral: 5
					// task_name: "每日登录"
					// type: 1
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.recordCard {
		background-color: #fff;
		padding: 20upx;

		.integral {
			color: #F69A30;
			font-weight: 800;
			font-size: 32upx
		}
	}
	.recored-bottom{
		border-bottom: 1rpx solid #ddd;
	}
</style>
